Dynomotion

Group: DynoMotion Message: 14383 From: Moray Cuthill Date: 2/9/2017
Subject: Displaying values within MsgBox text?
Hi all,

I'm sure I'm doing something stupid here, but I can't work out the code to display the value in a user variable in the text of a MsgBox.

For my Tool Changer initialisation program, I run a check that if the tool position is valid and the TC is idle, and provided those conditions are met, I want to ask the operator if the tool position is correct.

Here's the barebones code to display the MsgBox from my program-

int *Tool       = &persist.UserData[TOOL_VAR];

if((*ChangerState == T_IDLE) && ((*Tool > 0) && *Tool < 7))
 {
  printf("Tool=%d\n",*Tool);
  MsgBox("Tool Changer already initialized, with tool X in spindle.\nIs this correct?",MB_YESNO|MB_ICONEXCLAMATION);
 }

I have tried various ways to get the Tool value as part of the string, but every combination I've tried so far, results in a "cannot use pointers here" compiler error on the MsgBox line.
I know I'm getting the correct value as the printf statement prints the correct tool to the console, but I just can't get that into the MsgBox.

Is this possible, and if so, can somebody tell me how?

Thanks
Moray